{% extends "base.html" %}
{% block header %}
    <h2>{{ topic }}</h2>
{% endblock header %}


{% block content %}
    {#    <p>Topic:{{ topic }}</p>#}
    {#    <p>Entries:</p>#}
    <p>
        <a href="{% url 'learning_logs:new_entry' topic.id %}">add new entry</a>
    </p>
    <ul>
        {% for entry in entries %}
            <div class="panel panel-default">
                <div class="panel-heading">
                    {#            <li>#}
                    <h3>{{ entry.date_added|date:'M d,Y H:i ' }}
                        {#                <p>{{ entry.text|linebreaks }}</p>#}
                        <small>
                            <a href="{% url 'learning_logs:edit_entry' entry.id %}">edit entry</a>
                        </small>
                    </h3>
                    {#            </li>#}
                    <div class="panel-body">
                        {{ entry.text|linebreaks }}
                    </div>
                </div>
            </div>
        {% empty %}
            {#            <li>#}
            There are no entries for this topic yet.
            {#            </li>#}
        {% endfor %}
    </ul>
{% endblock content %}